﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DAL;

namespace BLL
{
    public class BLLDonHang
    {
        private string iddonhang;
        public string Iddonhang
        {
            get { return iddonhang; }
            set { iddonhang = value; }
        }

        private string idnguoidung;
        public string Idnguoidung
        {
            get { return idnguoidung; }
            set { idnguoidung = value; }
        }

        private string ngay;
        public string Ngay
        {
            get { return ngay; }
            set { ngay = value; }
        }
        private DateTime tungay;
        private DateTime denngay;
        public DateTime TuNgay
        {
            get { return tungay; }
            set { tungay = value; }
        }
        public DateTime DenNgay
        {
            get { return denngay; }
            set { denngay = value; }
        }
        private decimal tongtien;
        public decimal TongTien
        {
            get { return tongtien; }
            set { tongtien = value; }
        }

        private string trangthai;
        public string Trangthai
        {
            get { return trangthai; }
            set { trangthai = value; }
        }
        //private BLLNguoiDung nguoidung;
        //public BLLNguoiDung NguoiDung
        //{
        //    get { return nguoidung; }
        //    set { nguoidung = value; }
        //}
        //private List<BLLSanPham> sanpham;
        //public List<BLLSanPham> SanPham
        //{
        //    get { return sanpham; }
        //    set { sanpham = value; }
        //}
        //khoi tao
        public BLLDonHang()
        { }
        public BLLDonHang(string _id)
        {
            iddonhang = _id;
        }
        public BLLDonHang(string _iddh,string _idnd)
        {
            iddonhang = _iddh;
            Idnguoidung = _idnd;
        }

        public BLLDonHang(string _iddh, string _idnd, string _ngay,decimal _tongtien , string _trangthai)
        {
            Iddonhang = _iddh;
            Idnguoidung = _idnd;
            Ngay = _ngay;
            TongTien = _tongtien;
            Trangthai = _trangthai;
        }
        public BLLDonHang(string _id, string _ngay, string _trangthai)
        {
            Iddonhang = _id;
            Ngay = _ngay;
            Trangthai = _trangthai;
        }
        public BLLDonHang(string _id,string _ngay, DateTime  _tungay,DateTime _denngay, string _trangthai)
        {
            Iddonhang = _id;
            Ngay = _ngay;
            TuNgay = _tungay;
            DenNgay=_denngay;
            Trangthai = _trangthai;
        }
        //public BLLDonHang(string _iddh, string _idnd, string _ngay, decimal _tongtien, string _trangthai,BLLNguoiDung _nguoidung,List<BLLSanPham> _sanpham)
        //{
        //    Iddonhang = _iddh;
        //    Idnguoidung = _idnd;
        //    Ngay = _ngay;
        //    TongTien = _tongtien;
        //    Trangthai = _trangthai;
        //    NguoiDung = _nguoidung;
        //    SanPham = _sanpham;
        //}
        //them moi'
        public string Add
        {
            get { return DALDonHang.Add(this); }
        }
        //lay danh sach don hang
        public List<BLLDonHang> GetAll()
        {
            return DALDonHang.GetAll();
        }
        public List<BLLDonHang> GetByFilter()
        {
            return DALDonHang.GetByfilter(this);
        }
        //danh sach don hang theo User 
        public List<BLLDonHang> GetByUser()
        {
            return DALDonHang.GetByUser(this);
        }
        //lay dh theo id
        public List<BLLDonHang> GetById()
        {
            return DALDonHang.GetByID(this);
        }
        public string DeleteByUser()
        {
            return DALDonHang.DeletebyUser(this);
        }
        

    }
}
